Bug 539248 – gtk_calender_query_tooltip calls ->detail_func with invalid
authorMatthias Clasen <mclasen@redhat.com>
Sun, 6 Jul 2008 06:08:48 +0000 (06:08 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 6 Jul 2008 06:08:48 +0000 (06:08 +0000)
2008-07-06  Matthias Clasen  <mclasen@redhat.com>

        Bug 539248 – gtk_calender_query_tooltip calls ->detail_func with
        invalid dates

        * gtk/gtkcalendar.c (gtk_calendar_query_tooltip):
        Check that the cursor is over a valid date before retrieving
        its details.  Patch by Chris Wilson

svn path=/trunk/; revision=20789

ChangeLog
gtk/gtkcalendar.c

index 6788ff9f501fd73c460cb1518d3a579c5558f086..a348946ab97101f88a230c57aa77772583d21efc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-07-06  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 539248 – gtk_calender_query_tooltip calls ->detail_func with
+       invalid dates
+
+       * gtk/gtkcalendar.c (gtk_calendar_query_tooltip):
+       Check that the cursor is over a valid date before retrieving
+       its details.  Patch by Chris Wilson
+
 2008-07-06  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 493008 – gdk_screen_get_window_stack is not 64-bit-compatible
index 29f786717a8f2de5ec81cca2bde7be49ef9ad628..a1c73bb22e0bf58a2cffe10e25206e84cf85ca70 100644 (file)
@@ -1711,8 +1711,9 @@ gtk_calendar_query_tooltip (GtkWidget  *widget,
       col = calendar_column_from_x (calendar, x - x0);
       row = calendar_row_from_y (calendar, y - y0);
 
-      if (0 != (priv->detail_overflow[row] & (1 << col)) ||
-          0 == (calendar->display_flags & GTK_CALENDAR_SHOW_DETAILS))
+      if (col != -1 && row != -1 &&
+          (0 != (priv->detail_overflow[row] & (1 << col)) ||
+           0 == (calendar->display_flags & GTK_CALENDAR_SHOW_DETAILS)))
         {
           detail = gtk_calendar_get_detail (calendar, row, col);
           calendar_day_rectangle (calendar, row, col, &day_rect);